<div id="merchant_manage">
    <div class="merchant_manage">
        <el-row class="table_search">
            <el-col :span="18">
                <template>
                    <!--			<el-input type="input" v-model="city" style="width: 150px;" placeholder="所属城市Id"></el-input>-->
                    <!--					<el-select v-model="cityId" filterable placeholder="请选择城市" style="width: 180px;">
                                            <el-option
                                                    v-for="item in cityIds"
                                                    :key="item.cityCode"
                                                    :label="item.cityName"
                                                    :value="item.cityCode">
                                            </el-option>
                                        </el-select>-->
                    <!--					<el-input type="input" v-model="orgId" style="width: 150px;" placeholder="所属机构Id"></el-input>-->
                    <el-input type="text" v-model="orgName"  onclick="showMenu2();" id="jigou"  readonly clearable placeholder="所属机构" style="font-size: 12px;width:160px;"></el-input>
                    <div id="menuContent2" class="menuContent2" style="display:none; position: absolute;z-index: 1000;overflow: auto;">
                        <el-tree
                                :data="orgTree"
                                @node-click="treeClick2"
                                :props="defaultProps"
                                style="margin-top:0; width:200px;height:300px;"></el-tree>
                    </div>
                    <!--<el-input type="input" v-model="corpCode" style="width: 150px;font-size: 12px" id="merchantNum"  placeholder="商户编号"></el-input>-->
                    <el-input v-model="corpCode"
                              id="merchantNum"
                              style="width: 150px;font-size: 12px"
                              :clearable="true"
                              prefix-icon="el-icon-search">
                    </el-input>
                    <!--<el-input type="input" v-model="corpName" style="width: 150px; font-size: 12px" id="merchantName" placeholder="商户名称"></el-input>-->
                    <el-input v-model="corpName"
                              id="merchantName"
                              style="width: 150px;font-size: 12px"
                              :clearable="true"
                              prefix-icon="el-icon-search">
                    </el-input>
                    <el-select v-model="value" placeholder="全部状态" style="width:160px;" >
                        <el-option
                                v-for="item in options"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value">
                        </el-option>
                    </el-select>

                    <el-button type="primary" @click="searchFun" icon="el-icon-search" style="margin-left: 20px">搜索</el-button>
                </template>
            </el-col>
            <el-col :span="3" class="text-r">
                <el-button type="primary" icon="el-icon-plus" @click="addNew()">新增商户</el-button>
            </el-col>
            <el-col :span="3"  class="text-r">
                <el-button type="primary"  @click="exportMerchant"   icon="el-icon-plus">导出</el-button>
            </el-col>
        </el-row>

        <template>
            <el-table
                    size="mini"
                    :data="tableData"
                    @row-click="goUserDetails"
                    @cell-mouse-enter="userMouseEnterEvent"
                    style="width: 100%" >
                <el-table-column
                        align="center"
                        prop="corpCode"
                        label="商户编号"
                        width="120">
                </el-table-column>
                <el-table-column
                        align="center"
                        prop="corpName"
                        label="商户名称"
                        width="260">
                    <template slot-scope="scope">
						<span style="margin-left: 10px;cursor: pointer" >
							{{ scope.row.corpName }}
						</span>
                    </template>
                </el-table-column>
                <el-table-column
                        align="center"
                        width="120"
                        prop="orgName"
                        label="所属机构">
                </el-table-column>
<!--                <el-table-column
                        align="center"
                        width="120"
                        prop="cityName"
                        label="所属城市">
                </el-table-column>-->
                <el-table-column
                        align="center"
                        width="120"
                        prop="linkMan"
                        label="联系人">
                </el-table-column>
                <el-table-column
                        align="center"
                        width="120"
                        prop="linkPhone"
                        label="联系人电话">
                </el-table-column>
                <el-table-column align="center" width="200" label="状态" prop="status" >
                    <template slot-scope="scope">
                        <div class="switchBox" id="switchBox">
                            <label class="switchBtn" @click="selSwitchBox($event,scope.row.IEstatus)" >
                                <span class="switchWords">停用</span>
                                <i class="switchCircleActive" v-if="scope.row.IEstatus == true">
                                    <span class="switchCircleInfoActive"></span>
                                </i>
                                <i class="switchCircle" v-else>
                                    <span class="switchCircleInfo"></span>
                                </i>
                                <span class="switchWords" >启用</span>
                                <input type="checkbox" class="switchInput"  v-model="scope.row.IEstatus"   @change="disableMerchant(scope.$index, scope.row)">
                            </label>
                        </div>
                        <!--<el-switch-->
                                <!--v-model="scope.row.status"-->
                                <!--@change="disableMerchant(scope.$index, scope.row)"-->
                                <!--active-value="1"-->
                                <!--inactive-value="0"-->
                                <!--active-text="启用"-->
                                <!--inactive-text="停用"-->
                                <!--active-color="#13ce66"-->
                                <!--inactive-color="#ff4949">-->
                        <!--</el-switch>-->
                    </template>
                </el-table-column>
                <el-table-column label="操作" align="center">
                    <template slot-scope="scope">
                        <el-button type="primary" icon="el-icon-edit-outline" size="mini" @click="edit(scope.$index, scope.row)">编辑</el-button>

                        <!--		<el-button type="primary" size="mini" @click="disableMerchant(scope.$index, scope.row)" style="color: #fff">
                                    {{scope.row.status == '1'?'停用':'启用'}}
                                </el-button>-->
                    </template>
                </el-table-column>
            </el-table>

            <!--分页-->

            <div class="block footerBox" id="fenyeBox">
                <el-pagination
                        background
                        @current-change="handleCurrentChange"
                        layout="total, prev, pager, next, jumper"
                        :total="totalCount">
                </el-pagination>
            </div>
        </template>

    </div>
    <div class="isShowingBox" v-show="isShowingBox"></div>{{isOverflow}}
    <!--新增弹出框-->
    <el-dialog :title="dialogTitle" :close-on-press-escape="isEsc" :close-on-click-modal="ismodalClose" :show-close="showDelBtn" :visible.sync="dialogFormVisibleNew" >
        <span class="delDialogBtn" @click="closeAddDialogNew">x</span>
        <el-form
                class="add-template-form"
                :rules="rules"
                ref="addForm"
                :model="form"
                label-width="200px">
            <!-- 编辑隐藏 -->
            <!--<el-form-item label="商户ID：" prop="corpId" :label-width="formLabelWidth" hidden="hidden">-->
            <!--<el-input v-model="form.corpId" :disabled="true"></el-input>-->
            <!--</el-form-item>-->
            <!--<el-form-item label="商户编码：" prop="corpCode" :label-width="formLabelWidth" hidden="hidden">-->
            <!--<el-input v-model="form.corpCode" :disabled="true"></el-input>-->
            <!--</el-form-item>-->
            <!--多行文本框模板-->
            <el-form-item label="商户名称" prop="corpName" :label-width="formLabelWidth">
                <!--<el-input type="" v-model="form.corpName"></el-input>-->
                <input type="text" v-model="form.corpName" required lay-verify="required" autocomplete="off" class="layui-input">
            </el-form-item>
            <el-form-item label="所属城市" prop="cityId" :label-width="formLabelWidth">
                <!--<el-input type="" v-model="form.cityId"></el-input>-->
                <el-select v-model="form.cityId" filterable :disabled="form.citySelect" placeholder="请选择" style="width: 250px;">
                    <el-option
                            v-for="item in cityIds"
                            :key="item.cityCode"
                            :label="item.cityName"
                            :value="item.cityCode">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="所属机构" prop="orgId" :label-width="formLabelWidth">
                <!--<el-input type="" v-model="form.orgName"  onclick="showMenu();" :disabled="form.citySelect"  readonly ></el-input>-->
                <input type="text" v-model="form.orgName" onclick="showMenu();" :disabled="form.citySelect"  readonly autocomplete="off" class="layui-input">
                <div id="menuContent" class="menuContent" style="display:none; position: absolute;z-index: 1000;overflow: auto;">
                    <el-tree
                            :data="orgTree"
                            :props="defaultProps"
                            @node-click="treeClick"
                            style="margin-top:0; width:180px; height: 300px;"></el-tree>
                </div>
            </el-form-item>
            <el-form-item label="联系人" prop="linkMan" :label-width="formLabelWidth">
                <!--<el-input type="" v-model="form.linkMan"></el-input>-->
                <input type="text" v-model="form.linkMan" required lay-verify="required" autocomplete="off" class="layui-input">

            </el-form-item>
            <el-form-item label="联系人电话" prop="linkPhone" :label-width="formLabelWidth">
                <!--<el-input type="" v-model="form.linkPhone"></el-input>-->
                <input type="text" v-model="form.linkPhone" required lay-verify="required" autocomplete="off" class="layui-input">

            </el-form-item>
            <el-form-item label="联系人邮箱" prop="linkEmail" :label-width="formLabelWidth">
                <input type="text" v-model="form.linkEmail" required lay-verify="required" autocomplete="off" class="layui-input">
                <!--<el-input type="" v-model="form.linkEmail"></el-input>-->
            </el-form-item>
            <el-form-item label="对公账户" prop="cardNo" :label-width="formLabelWidth">
                <input type="text" v-model="form.cardNo" required lay-verify="required" autocomplete="off" class="layui-input">
                <!--<el-input type="" v-model="form.cardNo"></el-input>-->
            </el-form-item>
            <el-form-item label="是否推荐" prop="recommend" :label-width="formLabelWidth">
                <!--<el-input type="" v-model="form.recommend"></el-input>-->
                <!--<el-switch v-model="form.recommend" active-value="1" inactive-value="0" active-text="推荐" inactive-text="不推荐"></el-switch>-->
                <div class="switchBox">
                    <label class="switchBtn" @click="selSwitchBox($event,form.recommend)" >
                        <span class="switchWords">不推荐</span>
                        <i class="switchCircleActive" v-if="form.recommend == true">
                            <span class="switchCircleInfoActive"></span>
                        </i>
                        <i class="switchCircle" v-else>
                            <span class="switchCircleInfo"></span>
                        </i>
                        <span class="switchWords" >推荐</span>
                        <input type="checkbox" class="switchInput"  v-model="form.recommend"  >
                    </label>
                </div>
            </el-form-item>
            <el-form-item label="商户状态" prop="status" :label-width="formLabelWidth">
                <!--<el-input type="" v-model="form.stauts"></el-input>-->
                <!--<el-switch v-model="form.status" active-value="1" inactive-value="0" active-text="启用" inactive-text="停 用"></el-switch>-->
                <div class="switchBox">
                    <label class="switchBtn" @click="selSwitchBox($event,form.status)" >
                        <span class="switchWords">停 &nbsp;&nbsp;用</span>
                        <i class="switchCircleActive" v-if="form.status == true">
                            <span class="switchCircleInfoActive"></span>
                        </i>
                        <i class="switchCircle" v-else>
                            <span class="switchCircleInfo"></span>
                        </i>
                        <span class="switchWords" >启用</span>
                        <input type="checkbox" class="switchInput"  v-model="form.status"   >
                    </label>
                </div>
            </el-form-item>
            <el-form-item label="商户地址" prop="addr" :label-width="formLabelWidth">
                <!--<el-input type="textarea" v-model="form.addr" style="width: 450px;"></el-input>-->
                <textarea name="" v-model="form.addr"  class="layui-textarea" style="width: 450px;"></textarea>
            </el-form-item>
            <el-form-item label="商户描述" prop="corpDesc" :label-width="formLabelWidth">
                <textarea name="" v-model="form.corpDesc"  class="layui-textarea" style="width: 450px;"></textarea>
                <!--<el-input type="textarea" v-model="form.corpDesc" style="width: 450px;"></el-input>-->
            </el-form-item>

            <el-form-item label="商户LOGO" prop="logoFile" :label-width="formLabelWidth">
                <form id="uploadFormNew" action="" method="post" enctype="multipart/form-data" name="fileForm" >
                    <div class="imagesContainer">
                        <div id="previewNew">

                        </div>
                        <div class="imagBox">
                            <label for="uploadImgNew" id="labelImgNew"></label>
                            <input type="file" maxlength="1" id="uploadImgNew" name="upload_file" accept="image/png, image/jpg" @change="uploadImgNew($event)" />
                        </div>
                    </div>
                    <span class="noticeUploadImg">温馨提示：如需上传文件请单击右侧上传框，上传logo</span>
                    <!--<input type="button" @click="ajaxSubmitForm();" value="确定">-->
                    <i class="delImgBtn" v-if="isShowDelBtnNew" @click="removePic">x</i>
                </form>
            </el-form-item>

            <!--<el-form-item label="商户LOGO" prop="logoFile" :label-width="formLabelWidth">-->
            <!--<el-input v-model="form.logoFile" :disabled="true" style="width:202px;"></el-input>-->
            <!--<el-upload-->
            <!--class="upload-demo"-->
            <!--action="${basePath}bank/merchant/uploadPicFile"-->
            <!--name="upload_file"-->
            <!--accept=".jpg,.png"-->
            <!--:on-preview="viewPic"-->
            <!--:before-upload="beforeUpload"-->
            <!--:on-success='upLogoScuccess'-->
            <!--:on-remove="handleRemoveLogoFile"-->
            <!--:file-list="form.realLogFile"-->
            <!--:limit="1"-->
            <!--list-type="picture-card" style="width:202px;">-->
            <!--&lt;!&ndash;<el-button size="small" type="primary">点击上传</el-button>-->
            <!--<div slot="tip" class="el-upload__tip">只能上传图片，且不超过5M</div>&ndash;&gt;-->
            <!--<i class="el-icon-plus"></i>-->
            <!--</el-upload>-->

            <!--</el-form-item>-->

            <el-form-item label="商户合同" prop="contractFile" :label-width="formLabelWidth">

                <form id="uploadFormFileNew" action="" method="post" enctype="multipart/form-data" name="fileForm" >
                    <label for="fileAreaNew" class="fileAreaLabel">点击上传</label>
                    <input id="fileAreaNew" type="file" name="upload_file" @change="filesChangeNew">
                    <div class="showFileNameBox">
                        <span class="showFileName">{{fileNameModelNew}}</span><i class="delFileOldName" v-if="isShowRemoveAddBtn" @click="removeFile">x</i>
                    </div>
                </form>
                <!--<el-input v-model="form.contractFile" :disabled="true" style="width:202px;"></el-input>-->
                <!--<el-upload-->
                <!--class="upload-demo"-->
                <!--action="${basePath}bank/merchant/uploadFile"-->
                <!--name="upload_file"-->
                <!--accept=".jpg,.png,.pdf"-->
                <!--:before-upload="beforeUpload"-->
                <!--:on-success='upScuccess'-->
                <!--:on-remove="handleRemoveContractFile"-->
                <!--:file-list="form.realContractFile"-->
                <!--:limit="1">-->
                <!--<el-button size="small" type="primary">点击上传</el-button>-->
                <!--<div slot="tip" class="el-upload__tip">只能上传jpg/png/pdf文件，且不超过5M</div>-->
                <!--</el-upload>-->
            </el-form-item>

        </el-form>

        <div slot="footer" class="dialog-footer">
            <el-button @click="closeAddDialogNew">取 消</el-button>
            <el-button type="primary" @click="goConfirmAdd">确 定</el-button>
        </div>
    </el-dialog>

    <!--编辑弹出框-->
    <el-dialog :title="dialogTitle" :close-on-press-escape="isEsc" :close-on-click-modal="ismodalClose" :show-close="showDelBtn" :visible.sync="dialogFormVisible" >
        <span class="delDialogBtn" @click="closeAddDialog">x</span>
        <el-form
                class="add-template-form"
                :rules="rules"
                ref="form"
                :model="form"
                label-width="200px">
            <!-- 编辑隐藏 -->
            <!--<el-form-item label="商户ID：" prop="corpId" :label-width="formLabelWidth" hidden="hidden">-->
                <!--<el-input v-model="form.corpId" :disabled="true"></el-input>-->
            <!--</el-form-item>-->
            <!--<el-form-item label="商户编码：" prop="corpCode" :label-width="formLabelWidth" hidden="hidden">-->
                <!--<el-input v-model="form.corpCode" :disabled="true"></el-input>-->
            <!--</el-form-item>-->
            <!--多行文本框模板-->
            <el-form-item label="商户名称" prop="corpName" :label-width="formLabelWidth">
                <!--<el-input type="" v-model="form.corpName"></el-input>-->
                <input type="text" v-model="form.corpName" required lay-verify="required" autocomplete="off" class="layui-input">
            </el-form-item>
            <el-form-item label="所属城市" prop="cityId" :label-width="formLabelWidth">
                <!--<el-input type="" v-model="form.cityId"></el-input>-->
                <el-select v-model="form.cityId" filterable :disabled="form.citySelect" placeholder="请选择" style="width: 250px;">
                    <el-option
                            v-for="item in cityIds"
                            :key="item.cityCode"
                            :label="item.cityName"
                            :value="item.cityCode">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="所属机构" prop="orgId" :label-width="formLabelWidth">
                <!--<el-input type="" v-model="form.orgName"  onclick="showMenu();" :disabled="form.citySelect"  readonly ></el-input>-->
                <input type="text" v-model="form.orgName" onclick="showMenu();" :disabled="form.citySelect" autocomplete="off" class="layui-input">
                <div id="menuContent123" class="menuContent" style="display:none; position: absolute;z-index: 1000;overflow: auto;">
                    <el-tree
                            :data="orgTree"
                            :props="defaultProps"
                            @node-click="treeClick"
                            style="margin-top:0; width:180px; height: 300px;"></el-tree>
                </div>
            </el-form-item>
            <el-form-item label="联系人" prop="linkMan" :label-width="formLabelWidth">
                <!--<el-input type="" v-model="form.linkMan"></el-input>-->
                <input type="text" v-model="form.linkMan" required lay-verify="required" autocomplete="off" class="layui-input">
            </el-form-item>
            <el-form-item label="联系人电话" prop="linkPhone" :label-width="formLabelWidth">
                <!--<el-input type="" v-model="form.linkPhone"></el-input>-->
                <input type="text" v-model="form.linkPhone" required lay-verify="required" autocomplete="off" class="layui-input">
            </el-form-item>
            <el-form-item label="联系人邮箱" prop="linkEmail" :label-width="formLabelWidth">
                <!--<el-input type="" v-model="form.linkEmail"></el-input>-->
                <input type="text" v-model="form.linkEmail" required lay-verify="required" autocomplete="off" class="layui-input">
            </el-form-item>
            <el-form-item label="对公账户" prop="cardNo" :label-width="formLabelWidth">
                <!--<el-input type="" v-model="form.cardNo"></el-input>-->
                <input type="text" v-model="form.cardNo" required lay-verify="required" autocomplete="off" class="layui-input">
            </el-form-item>
            <el-form-item label="是否推荐" prop="recommend" :label-width="formLabelWidth">
                <!--<el-input type="" v-model="form.recommend"></el-input>-->
                <!--<el-switch v-model="form.recommend" active-value="1" inactive-value="0" active-text="推荐" inactive-text="不推荐"></el-switch>-->
                <div class="switchBox">
                    <label class="switchBtn" @click="selSwitchBox($event,form.recommend)" >
                        <span class="switchWords">不推荐</span>
                        <i class="switchCircleActive" v-if="form.recommend == true">
                            <span class="switchCircleInfoActive"></span>
                        </i>
                        <i class="switchCircle" v-else>
                            <span class="switchCircleInfo"></span>
                        </i>
                        <span class="switchWords" >推荐</span>
                        <input type="checkbox" class="switchInput"  v-model="form.recommend"  >
                    </label>
                </div>
            </el-form-item>
            <el-form-item label="商户状态" prop="status" :label-width="formLabelWidth">
                <!--<el-input type="" v-model="form.stauts"></el-input>-->
                <!--<el-switch v-model="form.status" active-value="1" inactive-value="0" active-text="启用" inactive-text="停 用"></el-switch>-->
                <div class="switchBox">
                    <label class="switchBtn" @click="selSwitchBox($event,form.status)" >
                        <span class="switchWords">停 &nbsp;&nbsp;用</span>
                        <i class="switchCircleActive" v-if="form.status == true">
                            <span class="switchCircleInfoActive"></span>
                        </i>
                        <i class="switchCircle" v-else>
                            <span class="switchCircleInfo"></span>
                        </i>
                        <span class="switchWords" >启用</span>
                        <input type="checkbox" class="switchInput"  v-model="form.status"   >
                    </label>
                </div>
            </el-form-item>
            <el-form-item label="商户地址" prop="addr" :label-width="formLabelWidth">
                <!--<el-input type="textarea" v-model="form.addr" style="width: 450px;"></el-input>-->
                <textarea name="" v-model="form.addr" style="width: 450px;" class="layui-textarea"></textarea>
            </el-form-item>
            <el-form-item label="商户描述" prop="corpDesc" :label-width="formLabelWidth">
                <!--<el-input type="textarea" v-model="form.corpDesc" style="width: 450px;"></el-input>-->
                <textarea name="" v-model="form.corpDesc" style="width: 450px;" class="layui-textarea"></textarea>
            </el-form-item>

            <el-form-item label="商户LOGO" prop="logoFile" :label-width="formLabelWidth">
                <form id="uploadForm" action="" method="post" enctype="multipart/form-data" name="fileForm" >
                    <div class="imagesContainer">
                        <div id="preview">
                           <img id="imghead" :src="imgSrc" style="width: 146px;height: 146px;">
                        </div>
                        <div class="imagBox">
                            <label for="uploadImg" id="labelImg"></label>
                            <input type="file" maxlength="1" id="uploadImg" name="upload_file" accept="image/png, image/jpg" @change="uploadImg123($event)" />
                        </div>
                    </div>
                    <span class="noticeUploadImg">温馨提示：如需上传文件请单击右侧上传框，上传logo</span>
                    <!--<input type="button" @click="ajaxSubmitForm();" value="确定">-->
                    <i class="delImgBtn" v-if="isShowDelBtn" @click="removePicOld">x</i>
                </form>
            </el-form-item>

            <!--<el-form-item label="商户LOGO" prop="logoFile" :label-width="formLabelWidth">-->
                <!--<el-input v-model="form.logoFile" :disabled="true" style="width:202px;"></el-input>-->
                <!--<el-upload-->
                        <!--class="upload-demo"-->
                        <!--action="${basePath}bank/merchant/uploadPicFile"-->
                        <!--name="upload_file"-->
                        <!--accept=".jpg,.png"-->
                        <!--:on-preview="viewPic"-->
                        <!--:before-upload="beforeUpload"-->
                        <!--:on-success='upLogoScuccess'-->
                        <!--:on-remove="handleRemoveLogoFile"-->
                        <!--:file-list="form.realLogFile"-->
                        <!--:limit="1"-->
                        <!--list-type="picture-card" style="width:202px;">-->
                    <!--&lt;!&ndash;<el-button size="small" type="primary">点击上传</el-button>-->
                    <!--<div slot="tip" class="el-upload__tip">只能上传图片，且不超过5M</div>&ndash;&gt;-->
                    <!--<i class="el-icon-plus"></i>-->
                <!--</el-upload>-->

            <!--</el-form-item>-->

            <el-form-item label="商户合同" prop="contractFile" :label-width="formLabelWidth">

                <form id="uploadFormFile" action="" method="post" enctype="multipart/form-data" name="fileForm" >
                    <label for="fileArea" class="fileAreaLabel">点击上传</label>
                    <input id="fileArea" type="file" name="upload_file" @change="filesChange">
                    <div class="showFileNameBox">
                        <span class="showFileName">{{fileNameModelOld}}</span><i class="delFileOldName" v-if="isShowRemoveBtn" @click="removeFile">x</i>
                    </div>

                </form>
                <!--<el-input v-model="form.contractFile" :disabled="true" style="width:202px;"></el-input>-->
                <!--<el-upload-->
                        <!--class="upload-demo"-->
                        <!--action="${basePath}bank/merchant/uploadFile"-->
                        <!--name="upload_file"-->
                        <!--accept=".jpg,.png,.pdf"-->
                        <!--:before-upload="beforeUpload"-->
                        <!--:on-success='upScuccess'-->
                        <!--:on-remove="handleRemoveContractFile"-->
                        <!--:file-list="form.realContractFile"-->
                        <!--:limit="1">-->
                    <!--<el-button size="small" type="primary">点击上传</el-button>-->
                    <!--<div slot="tip" class="el-upload__tip">只能上传jpg/png/pdf文件，且不超过5M</div>-->
                <!--</el-upload>-->
            </el-form-item>

        </el-form>

        <div slot="footer" class="dialog-footer">
            <el-button @click="closeAddDialog">取 消</el-button>
            <el-button type="primary" @click="goConfirm">确 定</el-button>
        </div>
    </el-dialog>
    <el-dialog :close-on-press-escape="isEsc" :close-on-click-modal="ismodalClose" :show-close="showDelBtn" :visible.sync="picDialogVisible" size="tiny" >
        <span class="delDialogBtn" @click="closeAddDialog">x</span>
        <img width="100%" :src="dialogImageUrl" alt="">
    </el-dialog>
    <el-dialog title="商户详情" :close-on-press-escape="isEsc" :close-on-click-modal="ismodalClose" :show-close="showDelBtn" :visible.sync="dialogInfoVisible" class="dialogDetails">
        <span class="delDialogBtn" @click="dialogInfoVisible=false;isShowingBox=false">x</span>
        <div class="info-template-content">
            <el-row class="item-row">
                <el-col :span="4" style="color: #666">商户ID</el-col>
                <el-col :span="15" style="color: #333">{{merchantInfo.corpId}}</el-col>
            </el-row>
            <el-row class="item-row">
                <el-col :span="4" style="color: #666">商户编号</el-col>
                <el-col :span="15" style="color: #333">{{merchantInfo.corpCode}}</el-col>
            </el-row>
            <el-row class="item-row">
                <el-col :span="4" style="color: #666">商户姓名</el-col>
                <el-col :span="15" style="color: #333">{{merchantInfo.corpName}}</el-col>
            </el-row>
            <el-row class="item-row">
                <el-col :span="4" style="color: #666">所属城市</el-col>
                <el-col :span="15" style="color: #333">{{merchantInfo.cityName}}</el-col>
            </el-row>
            <el-row class="item-row">
                <el-col :span="4" style="color: #666">所属机构</el-col>
                <el-col :span="15" style="color: #333">{{merchantInfo.orgName}}</el-col>
            </el-row>
            <el-row class="item-row">
                <el-col :span="4" style="color: #666">地址</el-col>
                <el-col :span="15" style="color: #333">{{merchantInfo.addr}}</el-col>
            </el-row>
            <el-row class="item-row">
                <el-col :span="4" style="color: #666">联系人</el-col>
                <el-col :span="15" style="color: #333">{{merchantInfo.linkMan}}</el-col>
            </el-row>
            <el-row class="item-row">
                <el-col :span="4" style="color: #666">联系人电话</el-col>
                <el-col :span="15" style="color: #333">{{merchantInfo.linkPhone}}</el-col>
            </el-row>
            <el-row class="item-row">
                <el-col :span="4" style="color: #666">联系人邮箱</el-col>
                <el-col :span="15" style="color: #333">{{merchantInfo.linkEmail}} </el-col>
            </el-row>
            <el-row class="item-row">
                <el-col :span="4" style="color: #666">对公账户</el-col>
                <el-col :span="15" style="color: #333">{{merchantInfo.cardNo}}</el-col>
            </el-row>
            <el-row class="item-row">
                <el-col :span="4" style="color: #666">推荐度</el-col>
                <el-col :span="15" style="color: #333">{{merchantInfo.recommendName}}</el-col>
            </el-row>
            <el-row class="item-row">
                <el-col :span="4" style="color: #666">状态</el-col>
                <el-col :span="15" style="color: #333">{{merchantInfo.statusName}}</el-col>
            </el-row>
            <el-row class="item-row">
                <el-col :span="4" style="color: #666">单位介绍</el-col>
                <el-col :span="18" style="color: #333">{{merchantInfo.corpDesc}}</el-col>
            </el-row>
            <el-row class="item-row">
                <el-col :span="4" style="color: #666">创建人</el-col>
                <el-col :span="15" style="color: #333">{{merchantInfo.creator}}</el-col>
            </el-row>
            <el-row class="item-row">
                <el-col :span="4" style="color: #666">创建时间</el-col>
                <el-col :span="15" style="color: #333">{{merchantInfo.createDate|formatDate}}</el-col>
            </el-row>
            <el-row class="item-row">
                <el-col :span="4" style="color: #666">更新人</el-col>
                <el-col :span="15" style="color: #333">{{merchantInfo.updator}}</el-col>
            </el-row>
            <el-row class="item-row">
                <el-col :span="4" style="color: #666">更新时间</el-col>
                <el-col :span="15" style="color: #333">{{merchantInfo.updateDate|formatDate}}</el-col>
            </el-row>
            <el-row  class="item-row">
                <el-col :span="4" style="color: #666">更新IP</el-col>
                <el-col :span="15" style="color: #333">{{merchantInfo.updateIp}}</el-col>
            </el-row>
            <el-row  class="item-row">
                <el-col :span="4" style="color: #666">合同</el-col>
                <el-col :span="15" style="color: #333">
                    <a :href="'${basePath}uploadFiles/file/'+ merchantInfo.contractFile"  target="_blank" >{{merchantInfo.contractFile!=''?'点击下载':''}}</a>
                </el-col>
            </el-row>
            <el-row  class="item-row" style="margin-bottom:0;height: 180px;">
                <el-col :span="4" style="color: #666">LOGO</el-col>
                <el-col :span="15" style="color: #333;position: relative">
                    <img :src='imgSrc'
                         height="146" width="146" style="position: absolute;left: 0px;top: 0px">
                </el-col>
            </el-row>
        </div>

    </el-dialog>



</div>

<script>
    $(function () {
        placeHolde("#jigou","所属机构");
        placeHolde("#merchantNum","商户编号");
        placeHolde("#merchantName","商户名称");
    });
    var layer,
        loadUser;
    layui.use('layer', function(){
        layer = layui.layer;
        loadUser  = layer.load(1, {shade: [0.5, '#000']});

    });


    Date.prototype.pattern=function(fmt) {
        var o = {
            "M+" : this.getMonth()+1, //月份
            "d+" : this.getDate(), //日
            "h+" : this.getHours()%12 == 0 ? 12 : this.getHours()%12, //小时
            "H+" : this.getHours(), //小时
            "m+" : this.getMinutes(), //分
            "s+" : this.getSeconds(), //秒
            "q+" : Math.floor((this.getMonth()+3)/3), //季度
            "S" : this.getMilliseconds() //毫秒
        };
        var week = {
            "0" : "/u65e5",
            "1" : "/u4e00",
            "2" : "/u4e8c",
            "3" : "/u4e09",
            "4" : "/u56db",
            "5" : "/u4e94",
            "6" : "/u516d"
        };
        if(/(y+)/.test(fmt)){
            fmt=fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length));
        }
        if(/(E+)/.test(fmt)){
            fmt=fmt.replace(RegExp.$1, ((RegExp.$1.length>1) ? (RegExp.$1.length>2 ? "/u661f/u671f" : "/u5468") : "")+week[this.getDay()+""]);
        }
        for(var k in o){
            if(new RegExp("("+ k +")").test(fmt)){
                fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
            }
        }
        return fmt;
    }
    var merchant_manage =
        new Vue({
            el: "#merchant_manage",

            data: {

                isShowRemoveAddBtn:false,
                isShowRemoveBtn:false,
                isShowDelBtnNew:false,
                isShowDelBtn:false,
                isCheckedUser:true,

                isShowingBox:false,
                showDelBtn:false,

                ismodalClose:false,
                isEsc:false,
                fileNameModel:'',
                fileNameModelNew:'',
                fileNameModelOld:'',
                isTrueName:false,
                imgSrc:'',
                dialogFormVisibleNew:false,


                picDialogVisible:false,
                dialogImageUrl:'',
                cityIds:'',//城市select
                orgTree:'',//机构tree
                defaultProps: {
                    label:'label',
                    children: 'children',
                    leaf:'leaf'
                },
                dialogTitle:'新增商户',
                dialogInfoVisible: false,//查看详情
                merchantInfo: {},//查看详情
                dialogFormVisible: false,
                form: {
                    citySelect:false,
                    corpId:'',
                    corpCode:'',
                    corpName:'',
                    orgId:'',
                    orgName:'',
                    cityId:'',
                    districtCode:'',
                    addr:'',
                    linkMan:'',
                    linkPhone:'',
                    linkEmail:'',
                    status:'1',
                    recommend:'',
                    corpDesc:'',
                    logoFile:'',
                    realLogFile:[],
                    contractFile:'',
                    realContractFile:[]
                },
                rules: {
                    corpName: [
                        { required: true, message: '请填写商户名称', trigger: 'blur' },
                        { min: 1, max: 100, message: '长度在 1 到 100 个字符', trigger: 'blur' }
                    ],
                    cityId: [
                        { required: true, message: '请选择所属城市', trigger: 'blur' }
                    ],
                    orgId: [
                        { required: true, message: '请选择所属机构', trigger: 'blur' }
                    ],
                    linkPhone: [
                        { required: true, message: '请填写联系电话', trigger: 'blur' },
                        { min: 1, max: 20, message: '长度在 1 到 20 个字符', trigger: 'blur' },
                        { pattern:/^1[345678]\d{9}$/, message:'电话号码格式不正确', trigger: 'blur' }
                    ],
                    cardNo: [
                        { required: true, message: '请填写对公账户', trigger: 'blur' },
                        { min: 1, max: 40, message: '长度在 1 到 40 个字符', trigger: 'blur' }
                    ] ,
                    addr: [
                        { required: true, message: '请填写商户地址', trigger: 'blur' },
                        { min: 1, max: 1000, message: '长度在 1 到 1000 个字符', trigger: 'blur' }
                    ],
                    linkEmail: [
                        { min: 1, max: 100, message: '长度在 1 到 100 个字符', trigger: 'blur' },
                        {type:'email',message:'请输入正确的邮箱',trigger:'blur,change'}
                    ],
                    linkMan: [
                        { min: 1, max: 100, message: '长度在 1 到 100 个字符', trigger: 'blur' }
                    ]

                },
                formLabelWidth: '120px',
                corpCode:'',//查询用商户code
                corpName:'',//查询用商户name
                cityId:'',//查询用商户所属城市
                orgId:'',//查询用商户机构ID
                orgName:'',
                options: [//查询用商户状态
                    {
                        value: '',
                        label: '全部状态'
                    }
                    ,
                    {
                        value: '1',
                        label: '启用'
                    },
                    {
                        value: '0',
                        label: '停用'
                    }
                ],
                parameters:{
                    orgIds:''
                },
                value: '',
                tableData: [],
                tableData123:[],
                totalCount:'',
                totalPage:'',
                currentPage: 1,
                pageSize:10
            },
            filters: {
                formatDate:function(time) {
                    var date = new Date(time);
                    return date.pattern("yyyy-MM-dd hh:mm:ss");
                }
            },
            methods: {
                exportMerchant:function(){
                    window.location.href = "${basePath}bank/exportToExcel";
                },
                clearlNotice:function(f) {
                    $('#uploadFormFile')[0].reset();
                    document.getElementById("uploadForm").reset();
                    $("#preview")[0].innerHTML = '<img id="imghead" src="">';
                    this.backHome();
                    this.$refs[f].clearValidate();
                    this.fileNameModel='';
                },
                backHome:function () {

                    this.closeAddDialog();
                    this.isShowingBox = false;
                    this.dialogFormVisible = false;
                    this.dialogInfoVisible = false;

                    this.dialogFormVisibleNew = false;
                },
                /**
                 * 点击X关闭模态框
                 * */
                closeAddDialog:function () {
                    //$('#uploadFormFile')[0].reset();
                    this.fileNameModel='';
                    //$("#preview")[0].innerHTML = '<img id="imghead" src="">';
                    var form = this.$refs.form;
                    form.clearValidate();
                    this.isShowingBox = false;
                    this.dialogFormVisible = false;
                    this.dialogInfoVisible = false;

                    this.dialogFormVisibleNew = false;
                },
                closeAddDialogNew:function () {
                    this.isShowDelBtnNew = false;
                    $('#uploadFormNew')[0].reset();
                    $('#uploadFormFileNew')[0].reset();
                    this.fileNameModel='';
                    this.fileNameModelNew='';
                    $("#previewNew")[0].innerHTML = '<img id="imghead" src="">';
                    var form = this.$refs.addForm;
                    form.clearValidate();
                    this.isShowingBox = false;
                    this.dialogFormVisible = false;
                    this.dialogInfoVisible = false;

                    this.dialogFormVisibleNew = false;
                },
                treeClick2:function(o,node,tree){
                    merchant_manage.orgId = o.id;
                    merchant_manage.orgName = o.label;
                    $("#menuContent2").fadeOut("fast");

                },
                treeClick:function(o,node,tree){
                    merchant_manage.form.orgId = o.id;
                    merchant_manage.form.orgName = o.label;
                    $("#menuContent").fadeOut("fast");

                },

//                beforeUpload:function(file){
//                    var isLt5M = file.size / 1024 / 1024 < 5;
//                    if (!isLt5M) {
//                        merchant_manage.$message.error('上传文件不能超过 5MB!');
//                    }
//                    return isLt5M;
//                },
                /**
                 * 已完成
                 */
//                upScuccess: function (response, file, fileList) {
//                    merchant_manage.form.contractFile = response;
//                },
//                upLogoScuccess: function (response, file, fileList) {
//                    merchant_manage.form.logoFile = response;
//                },
//                viewPic:function(file){
//                    merchant_manage.dialogImageUrl = file.url;
//                    merchant_manage.picDialogVisible = true;
//                },
//                handleRemoveContractFile: function (file, fileList) {
//                    var url = "${basePath}bank/merchant/removeFile";
//                    var option = {
//                        'fileName': merchant_manage.form.contractFile,
//                        'fileType': 'file'
//                    };
//                    sendService(url, option, function (resData) {
//                        if (resData.status == 'success') {
//                            merchant_manage.form.contractFile = "";
//                        }
//                    });
//                },
//      {"citySelect":true,"corpId":"435","corpCode":"3747A011","corpName":"新年123456","orgId":"3","orgName":"济南北园路支行","cityId":"370100","districtCode":"","addr":"123","linkMan":"","linkPhone":"13222222222","linkEmail":"","status":"1","recommend":"0","corpDesc":"","logoFile":"c86f468b31fa41d1b926ae489ce4285220180110163202.jpg","realLogFile":[{"name":"c86f468b31fa41d1b926ae489ce4285220180110163202.jpg","url":"http://localhost:8080/uploadFiles/uploadImgs/c86f468b31fa41d1b926ae489ce4285220180110163202.jpg"}],"contractFile":"","realContractFile":[],"cardNo":"123123"}


      //{"citySelect":true,"corpId":"435","corpCode":"3747A011","corpName":"新年123456","orgId":"3","orgName":"济南北园路支行","cityId":"370100","districtCode":"","addr":"123","linkMan":"","linkPhone":"13222222222","linkEmail":"","status":"1","recommend":"0","corpDesc":"","logoFile":"6c27e42138e242d29c036a3d6ea408ae20180110171247.jpg","realLogFile":[{"name":"a4cbbdb9c41442e0a0b5a11feec73b4b20180110171147.jpg","url":"http://localhost:8080/uploadFiles/uploadImgs/a4cbbdb9c41442e0a0b5a11feec73b4b20180110171147.jpg","uid":1515575558771,"status":"success"}],"contractFile":"","realContractFile":[],"cardNo":"123123"}

    //                handleRemoveLogoFile: function (file, fileList) {
//                    var url = "${basePath}bank/merchant/removeFile";
//                    var option = {
//                        'fileName': merchant_manage.form.logoFile,
//                        'fileType': 'picture'
//                    };
//                    sendService(url, option, function (resData) {
//                        if (resData.status == 'success') {
//                            merchant_manage.form.logoFile = "";
//                        }
//                    });
//                },
                filesChange:function () {
                    var nameFlis = $("#fileArea").val();
                    if(nameFlis != ''){
                        merchant_manage.isShowDelBtn = true;
                    }else {
                        merchant_manage.isShowDelBtn = false;
                    }
                    var fileName123 = nameFlis.split("\\");
                    this.fileNameModelOld = fileName123[fileName123.length-1];
                    var endName = this.fileNameModelOld.split(".")[1];
                    if(endName == 'jpg' ||endName == 'png' ||endName == 'pdf'){
                        this.ajaxSubmitFormFile("bank/merchant/uploadFile");
                    }else {
                        this.isTrueName = false;
                        layer.msg('请选择jpg、png、png格式文件上传', {icon: 5});
                    }
                },
                filesChangeNew:function () {
                    var nameFlis = $("#fileAreaNew").val();
                    var fileName123 = nameFlis.split("\\");
                    this.fileNameModelNew = fileName123[fileName123.length-1];
                    var endName = this.fileNameModelNew.split(".")[1];
                    if(endName == 'jpg' ||endName == 'png' ||endName == 'pdf'){
                        this.isShowRemoveAddBtn = true;
                        this.ajaxSubmitFormFileNew("bank/merchant/uploadFile");
                    }else {
                        this.fileNameModelNew = '';
                        this.isTrueName = false;
                        layer.msg('请选择jpg、png、png格式文件上传', {icon: 5});
                    }
                },
                uploadImg123:function (e) {
                    this.isShowDelBtn = true;
                    previewImage(e.currentTarget,'preview','imghead');
                    this.ajaxSubmitForm('bank/merchant/uploadPicFile');
                },
                uploadImgNew:function (e) {
                    this.isShowDelBtnNew = true;
                    previewImage(e.currentTarget,'previewNew','imghead');
                    this.ajaxSubmitFormNew('bank/merchant/uploadPicFile');
                },
                removePic:function () {
                    var that = this;
                    var url = "${basePath}bank/merchant/removeFile";
                    var newImgName = sessionStorage.getItem('newImgName');
                    var option = {
                        'fileName': newImgName,
                        'fileType': 'picture'
                    };
                    sendService(url, option, function (resData) {
                        if (resData.status == 'success') {
                            that.isShowDelBtnNew = false;
                            that.isShowDelBtn = false;
                            that.imgSrc = '';
                            sessionStorage.setItem("newImgName",'23333');
                            $("#previewNew")[0].innerHTML = '<img id="imghead" src="">';
                        }
                    });
                },
                removePicOld:function () {
                    var that = this;
                    var url = "${basePath}bank/merchant/removeFile";
                    var newImgName = sessionStorage.getItem('newImgName');
                    var option = {
                        'fileName': newImgName,
                        'fileType': 'picture'
                    };
                    sendService(url, option, function (resData) {
                        if (resData.status == 'success') {
                            that.isShowDelBtnNew = false;
                            that.isShowDelBtn = false;
                            that.imgSrc = '';
                            sessionStorage.setItem("newImgName",'');
                        }
                    });
                },
                removeFile:function () {
                    var that = this;
                    var newFileName = sessionStorage.getItem('newFileName');
                    var url = "${basePath}bank/merchant/removeFile";
                    var option = {
                        'fileName': newFileName,
                        'fileType': 'file'
                    };
                    sendService(url, option, function (resData) {
                        if (resData.status == 'success') {
                            that.isShowRemoveAddBtn = false;
                            that.isShowRemoveBtn = false;
                            that.fileNameModelNew = '';
                            that.fileNameModelOld = '';
                            sessionStorage.setItem("newFileName",'');
                        }
                    });
                },
                ajaxSubmitForm:function(url) {
                    var that = this;
                    var option = {
                        url : '${basePath}'+url,
                        type : 'POST',
                        dataType : 'json',
                        headers : {"ClientCallMode" : "ajax"}, //添加请求头部
                        success : function(data) {
                        },
                        error: function(data) {
                            sessionStorage.setItem("newImgName",data.responseText);
                        }
                    };
                    $("#uploadForm").ajaxSubmit(option);
                    return false;
                },
                ajaxSubmitFormNew:function(url) {
                    var that = this;
                    var option = {
                        url : '${basePath}'+url,
                        type : 'POST',
                        dataType : 'json',
                        headers : {"ClientCallMode" : "ajax"}, //添加请求头部
                        success : function(data) {
                        },
                        error: function(data) {
                            sessionStorage.setItem("newImgName",data.responseText);
                        }
                    };
                    $("#uploadFormNew").ajaxSubmit(option);
                    return false;
                },
                ajaxSubmitFormFile:function(url) {
                    var that = this;
                    var option = {
                        url : '${basePath}'+url,
                        type : 'POST',
                        dataType : 'json',
                        headers : {"ClientCallMode" : "ajax"}, //添加请求头部
                        success : function(data) {
                        },
                        error: function(data) {
                            sessionStorage.setItem("newFileName",data.responseText);
                        }
                    };
                    $("#uploadFormFile").ajaxSubmit(option);
                    return false;
                },
                ajaxSubmitFormFileNew:function(url) {
                    var that = this;
                    var option = {
                        url : '${basePath}'+url,
                        type : 'POST',
                        dataType : 'json',
                        headers : {"ClientCallMode" : "ajax"}, //添加请求头部
                        success : function(data) {
                        },
                        error: function(data) {
                            sessionStorage.setItem("newFileName",data.responseText);
                        }
                    };
                    $("#uploadFormFileNew").ajaxSubmit(option);
                    return false;
                },
                /*
                 *完成新增操作
                 * */
                goConfirm: function () {
                    this.$refs['form'].validate(
                        function (valid) {
                            if (valid) {
                                var url = "${basePath}bank/merchant/saveMerchant";
                                var option = merchant_manage.form;
                                var newImgName = sessionStorage.getItem('newImgName');
                                var newFileName = sessionStorage.getItem('newFileName');
                                option.logoFile = newImgName;
                                option.contractFile = newFileName;
                                if(option.recommend == true){
                                    option.recommend = '1';
                                }
                                if(option.recommend == false){
                                    option.recommend = '0';
                                }
                                if(option.status == true){
                                    option.status ='1'
                                }
                                if(option.status == false){
                                    option.status ='0'
                                }
                                sendService("${basePath}bank/merchant/saveMerchant", option, function (resData) {
                                    console.log(JSON.stringify(option));
                                    if (resData.status == 'success') {
                                        layer.msg(resData.msg, {icon: 6});
                                        $(".main-right").empty();
                                        $(".main-right").load('${basePath}/merchant_list_IE');
                                    } else {
                                        layer.msg(resData.msg, {icon: 5});
                                    }
                                    merchant_manage.isShowingBox = false;
                                    merchant_manage.dialogFormVisible = false;
                                });
                            } else {
                                layer.msg("表单验证失败，请检查", {icon: 5});
                                return false;
                            }

                        }
                    );
                },
                goConfirmAdd: function () {
                    this.$refs['addForm'].validate(
                        function (valid) {
                            if (valid) {
                                var url = "${basePath}bank/merchant/saveMerchant";
                                var option = merchant_manage.form;
                                var newImgName = sessionStorage.getItem('newImgName');
                                var newFileName = sessionStorage.getItem('newFileName');
                                option.logoFile = newImgName;
                                option.contractFile = newFileName;
                                if(option.recommend == true){
                                    option.recommend = '1';
                                }
                                if(option.recommend == false){
                                    option.recommend = '0';
                                }
                                if(option.status == true){
                                    option.status ='1'
                                }
                                if(option.status == false){
                                    option.status ='0'
                                }
                                sendService("${basePath}bank/merchant/saveMerchant", option, function (resData) {
                                    console.log(JSON.stringify(option));
                                    if (resData.status == 'success') {
                                        layer.msg(resData.msg, {icon: 6});
                                        $(".main-right").empty();
                                        $(".main-right").load('${basePath}/merchant_list_IE');
                                    } else {
                                        layer.msg(resData.msg, {icon: 5});
                                    }
                                    merchant_manage.isShowingBox = false;
                                    merchant_manage.dialogFormVisible = false;
                                });
                            } else {
                                layer.msg("表单验证失败，请检查", {icon: 5});
                                return false;
                            }

                        }
                    );
                },
                addNew:function () {
                    merchant_manage.form.citySelect = false;
                    merchant_manage.form.corpId = '';
                    merchant_manage.form.corpCode = '';
                    merchant_manage.form.corpName = '';
                    merchant_manage.form.cityId = '';
                    merchant_manage.form.orgId = '';
                    merchant_manage.form.orgName = '';
                    merchant_manage.form.addr = '';
                    merchant_manage.form.linkMan = '';
                    merchant_manage.form.linkPhone = '';
                    merchant_manage.form.linkEmail = '';
                    merchant_manage.form.status = true;
                    merchant_manage.form.cardNo = '';
                    merchant_manage.form.recommend = false;
                    merchant_manage.form.corpDesc = '';
                    merchant_manage.form.logoFile = '';
                    merchant_manage.form.realLogFile = [];
                    merchant_manage.form.contractFile = '';
                    merchant_manage.form.realContractFile = [];

                    this.dialogFormVisibleNew = true;
                    this.isShowingBox = true;
                },
                edit: function (index, row) {
                    if (index != undefined) {
                        window.event.cancelBubble = true;
//                        if (event.stopPropagation){
//                            // this code is for Mozilla and Opera
//                            event.stopPropagation();
//                        }else if (window.event) {
//                            // this code is for IE
//                            window.event.cancelBubble = true;
//                        }
                        merchant_manage.form.citySelect = true;
                        merchant_manage.form.corpId = row.corpId;
                        merchant_manage.form.corpCode = row.corpCode;
                        merchant_manage.form.corpName = row.corpName;
                        merchant_manage.form.cityId = row.cityId;
                        merchant_manage.form.orgId = row.orgId;
                        merchant_manage.form.orgName = row.orgName;
                        merchant_manage.form.addr = row.addr;
                        merchant_manage.form.linkMan = row.linkMan;
                        merchant_manage.form.linkPhone = row.linkPhone;
                        merchant_manage.form.linkEmail = row.linkEmail;
                        merchant_manage.form.cardNo = row.cardNo;
                        merchant_manage.form.corpDesc = row.corpDesc;
                        merchant_manage.form.status = row.status=='0'?false:true;
                        merchant_manage.form.recommend = row.recommend=='0'?false:true;
                        merchant_manage.form.logoFile = row.logoFile;

                        if(row.logoFile!=null && row.logoFile != ""){
                            merchant_manage.form.realLogFile = [{
                                name: row.logoFile,
                                url: '${basePath}uploadFiles/uploadImgs/' +row.logoFile
//									url: '${basePath}bank/downloadPic?filePath=uploadFiles//uploadImgs//' + row.logoFile
                            }];
                            merchant_manage.imgSrc = '${basePath}uploadFiles/uploadImgs/' +row.logoFile;
                            merchant_manage.isShowDelBtn = true;
                        }else{
                            merchant_manage.form.realLogFile = [];
                            merchant_manage.isShowDelBtn = false;
                        }
                        merchant_manage.form.contractFile = row.contractFile;
                        if(row.contractFile!=null && row.contractFile != ""){
                            merchant_manage.form.realContractFile = [{
                                name: row.contractFile,
                                url: '${basePath}uploadFiles/file/' + row.contractFile
                            }];
                            merchant_manage.isShowRemoveBtn = true;
                            merchant_manage.fileNameModelOld =row.contractFile;
                        }else{
                            merchant_manage.form.realContractFile = [];
                        }

                        merchant_manage.dialogTitle = "编辑商户";
                        merchant_manage.dialogFormVisible = true;
                        merchant_manage.isShowingBox = true;
                    }else{
                        merchant_manage.form.citySelect = false;
                        merchant_manage.form.corpId = '';
                        merchant_manage.form.corpCode = '';
                        merchant_manage.form.corpName = '';
                        merchant_manage.form.cityId = '';
                        merchant_manage.form.orgId = '';
                        merchant_manage.form.orgName = '';
                        merchant_manage.form.addr = '';
                        merchant_manage.form.linkMan = '';
                        merchant_manage.form.linkPhone = '';
                        merchant_manage.form.linkEmail = '';
                        merchant_manage.form.status = true;
                        merchant_manage.form.cardNo = '';
                        merchant_manage.form.recommend = false;
                        merchant_manage.form.corpDesc = '';
                        merchant_manage.form.logoFile = '';
                        merchant_manage.form.realLogFile = [];
                        merchant_manage.form.contractFile = '';
                        merchant_manage.form.realContractFile = [];

                        merchant_manage.dialogTitle = "新增商户";
                        merchant_manage.isShowingBox = true;
                        merchant_manage.dialogFormVisible = true;
                        //$("#preview")[0].innerHTML = '<img id="imghead" src="">';
                    }
                },
                /**
                 * 已完成
                 */
                handleCurrentChange: function(currentPage){
                    merchant_manage.currentPage = currentPage;
                    merchant_manage.searchFun();
                },
                /**
                 * 已完成
                 */
                searchFun: function () {
                    if(merchant_manage.orgName == ''){
                        merchant_manage.orgId = '';
                    }
                    var options = {
                        'currentPage':merchant_manage.currentPage,
                        'status':merchant_manage.value,
                        'corpCode':merchant_manage.corpCode,
                        'corpName':merchant_manage.corpName,
                        'orgId':merchant_manage.orgId,
                        'cityId':merchant_manage.cityId,
                        orgIds:merchant_manage.parameters.orgIds
                    };
                    var url = '${basePath}bank/getMerchantList';
                    sendService(url, options, function (resData) {
                        if(resData.status == 'success'){
                            merchant_manage.tableData = resData.t.merchantList;
                            merchant_manage.totalPage = resData.page.totalPage;
                            merchant_manage.totalCount = resData.page.totalResult;
                            fenYeProblem(resData.page.totalPage);

                            var statusIE = merchant_manage.tableData;

                            for(var i = 0;i < merchant_manage.tableData.length;i++){
                                if(merchant_manage.tableData[i].status == '0'){
                                    merchant_manage.tableData[i].IEstatus = false;
                                }else  if(merchant_manage.tableData[i].status == '1'){
                                    merchant_manage.tableData[i].IEstatus = true;
                                }
                            }
                        }
                    })
                },
                /**
                 * 开关
                 */
                selSwitchBox:function (e,s) {
                    if(s == false || s == '0'){
                        $(e.currentTarget).find("i").attr("class","switchCircle");
                        $(e.currentTarget).find("i").children().attr("class","switchCircleInfo");
                    }
                    if(s == true || s == '1'){
                        $(e.currentTarget).find("i").attr("class","switchCircleActive");
                        $(e.currentTarget).find("i").children().attr("class","switchCircleInfoActive");
                    }
                },
                disableMerchant: function (index, row) {//禁用/启用商户
                    window.event.cancelBubble = true;
                    var statusUp = row.IEstatus;
                    var params = {
                        status:statusUp == true?'1':'0',
                        corpId:row.corpId
                    };
                    var url = '${basePath}bank/updateMerchant';
                    sendService(url, params, function (resData) {
                        var successOrfail ;
                        if(resData.status == 'success'){
                            layer.msg(resData.msg, {icon: 6});

                        }else{
                            layer.msg(resData.msg, {icon: 5});
                        }
                    });
                    //reloadPage('${basePath}/merchant_list_IE');
                },
                /**
                 * 已完成
                 */
                handleRowHandle: function (row) {
//                    this.isShowingBox =true;
//                    merchant_manage.dialogInfoVisible = true;
//                    merchant_manage.merchantInfo = row;
//                    merchant_manage.imgSrc = '${basePath}uploadFiles/uploadImgs/' +row.logoFile;
                },
                /**
                 * 已完成
                 */
                goPage: function (url) {
                    $(".main-right").empty();
                    $(".main-right").load('${basePath}'+url);
                },
                filterMerchantStatusType: function (value, row) {

                    row.status = (value == 1);
                },
                goUserDetails:function(row, event, column){
                    if(column.label != '操作'&&column.label != '状态'){
                        this.isShowingBox =true;
                        merchant_manage.dialogInfoVisible = true;
                        merchant_manage.merchantInfo = row;
                        merchant_manage.imgSrc = '${basePath}uploadFiles/uploadImgs/' +row.logoFile;
                    }
                    if(column.label == '操作'|| column.label == '用户状态'){
                        return
                    }
                },
                userMouseEnterEvent:function(row, event, column){
                    if(event.label == '操作' || column.label == '状态'){
                        column.style.cursor="default"
                    }else {
                        column.style.cursor="pointer"
                    }
//                    if(event.label != '操作' || column.label != '状态'){
//                        column.style.cursor="pointer"
//                    }
                },
            },
            /**
             * 已完成
             */
            created: function () {
                sendService("${basePath}bank/org/getUserSelectOrgTree", null, function (resData) {
                    if(null != resData.t) {
                        merchant_manage.orgTree = resData.t;
                        merchant_manage.parameters.orgIds = getChildrenId(resData.t);

                        var url = '${basePath}bank/getMerchantList';
                        var options = { currentPage:1,orgIds:merchant_manage.parameters.orgIds };
                        sendService(url, options, function (resData) {
                            if(resData.status == 'success'){
                                layer.close(loadUser);
                                merchant_manage.totalPage = resData.page.totalPage;
                                merchant_manage.totalCount = resData.page.totalResult;
                                merchant_manage.cityIds =  resData.t.cityList;
                                merchant_manage.tableData = resData.t.merchantList;
                               fenYeProblem(resData.page.totalPage);
                                var statusIE = resData.t.merchantList;
                                for(var i = 0;i < statusIE.length;i++){
                                    if(statusIE[i].status == '0'){
                                        merchant_manage.tableData123.push(false);
                                    }else  if(statusIE[i].status == '1'){
                                        merchant_manage.tableData123.push(true);
                                    }
                                }

                                for(var j = 0;j < merchant_manage.tableData.length;j++){
                                    merchant_manage.tableData[j].IEstatus = merchant_manage.tableData123[j];
                                }
                            }
                        });
                    }
                });
            },
            computed:{
                isOverflow:function () {
                    if(this.isShowingBox){
                        $(".main-right").css({'overflow':"hidden"});
                    }
                    if(!this.isShowingBox){

                        $(".main-right").css({'overflow':"auto"});
                    }

                }
            }
        });

    function showMenu() {
        if(merchant_manage.form.citySelect){
            return ;
        }

        $("#menuContent").slideDown("fast")
    }
    function showMenu2() {
        $("#menuContent2").slideDown("fast");
        $("body").bind("mousedown", onBodyDown2);
    }
    function onBodyDown(event) {
        if (!(event.target.id == "menuBtn" || event.target.id == "citySel" || event.target.id == "menuContent" || $(event.target).parents("#menuContent2").length>0)) {
            hideMenu();
        }
    }
    function onBodyDown2(event) {
        if (!(event.target.id == "menuBtn" || event.target.id == "citySel" || event.target.id == "menuContent2" || $(event.target).parents("#menuContent2").length>0)) {
            hideMenu2();
        }
    }
    function hideMenu() {
        $("#menuContent2").fadeOut("fast");
        $("body").unbind("mousedown", onBodyDown);
    }
    function hideMenu2() {
        $("#menuContent2").fadeOut("fast");
        $("body").unbind("mousedown", onBodyDown2);
    }
    function getChildrenId(children){
        var str = "";
        if (children != null){
            children.forEach(function (item) {
                str = str + item.id + ",";
                var child = item.children;
                if(child != null){
                    str = str + getChildrenId(child) ;
                }
            });
        }
        return str;
    }

</script>

<style scoped>
    .layui-textarea, .layui-input{
        width: 250px;
    }
    /*显示文件名*/
    .showFileNameBox{
        display: inline-block;
        position: relative;
        width: 150px;
    }
    .showFileName{
       display: inline-block;
        margin-bottom: -16px;
        width: 150px;
        overflow: hidden;
        text-overflow:ellipsis;
        white-space: nowrap;
    }
    .delFileOldName{
        font-style: normal;
        position: absolute;
        right: -14px;
        top: 50%;
        margin-top: -7px;
        height: 14px;
        width: 14px;
        font-size: 12px;
        line-height: 14px;
        text-align: center;
        color: #fff;
        background-color: #00aced;
        border-radius: 50%;
        cursor: pointer;
    }
    .delFileOldName:hover{
        background-color: #00B83F;
    }
    /*图片删除按钮*/
    .delImgBtn{
        font-style: normal;
        position: absolute;
        left: 0px;
        top: 0;
        width: 18px;
        height: 18px;
        line-height: 18px;
        text-align: center;
        font-size: 16px;
        color: #666;
        background-color: #ddd;
        border: 1px solid #ccc;
        border-radius: 5px;
        z-index: 23333333;
        cursor: pointer;
    }
    .delImgBtn:hover{
        color: #fff;
        background-color: #666;
    }


    .fileAreaLabel{
        padding: 9px 15px;
        font-size: 12px;
        color: #fff;
        background-color: #409EFF;
        border-radius: 3px;
    }
    #fileArea{
        position: absolute;
        left: -3000px;
    }
    #fileAreaNew{
        position: absolute;
        left: -3000px;
    }

    .switchInput{
        display: none;
    }
    /* 开关样式开始 */
    .switchBox{
        display: inline-block;
        line-height: 20px;
    }
    .switchBox .switchBtn{
        position: relative;
        display: inline-block;
        margin-top: 15px;
        cursor: pointer;
    }
    .switchWords{
        vertical-align: middle;
        display: inline-block;
        margin: 0 5px;
        margin-bottom: 15px;

    }
    .switchCircle{
        position: relative;
        display: inline-block;
        width: 40px;
        height: 20px;
        border-radius: 10px;
        background-color: #ff4444;
    }
    .switchCircleActive{
        position: relative;
        display: inline-block;
        width: 40px;
        height: 20px;
        border-radius: 10px;
        background-color: #13ce66;
    }
    .switchCircle .switchCircleInfo{
        width: 18px;
        height: 18px;
        border-radius: 50%;
        background-color: #fff;
        position: absolute;
        left: 1px;
        top: 1px;
    }

    .switchCircleInfoActive{
        width: 18px;
        height: 18px;
        border-radius: 50%;
        background-color: #fff;
        position: absolute;
        right: 1px;
        top: 1px;
    }
    /* 开关样式结束 */







    .el-table__header,.el-table__body{
        width: 100% !important;
    }
    .el-table tr{
        height: 40px;
    }
    .addUsrtBtn{
        padding: 9px 15px;
        font-size: 12px;
    }
    /*table按钮样式调整开始*/
    .el-button--mini, .el-button--mini.is-round{
        padding: 4px 10px;
    }
    .userManageBox .editBtn{
        color: #409EFF;
        background-color: transparent;
        border-color: transparent;
    }
    .userManageBox .editBtn:hover{
        color: #fff;
        background-color: #409EFF;
        border-color: #409EFF;
    }

    .userManageBox .delBtn{
        color: #fa5555;
        background-color: transparent;
        border-color: transparent;
    }
    .userManageBox .delBtn:hover{
        color: #fff;
        background-color: #fa5555;
        border-color: #fa5555;
    }
    .userManageBox .resetBtn{
        color: #02dda7;
        background-color: transparent;
        border-color: transparent;
    }
    .userManageBox .resetBtn:hover{
        color: #fff;
        background-color: #02dda7;
        border-color: #02dda7;
    }
    .userManageBox .el-button{
        margin-left: 0;
    }
    /*table按钮样式调整结束*/
    .table_search, .table_btn{
        height: 60px;
        margin-bottom: 10px;
        background: #fff;
        padding: 10px 20px 30px;
    }
    /*.el-table td, .el-table th.is-leaf{*/
    /*border: none;*/
    /*}*/
    .el-table::before{
        height: 0;
    }
    .addUserBox{
        margin-bottom: 0;
        border-bottom: 1px solid #f2f4f8;
    }
    .el-input{
        width: auto;
    }
    .text-r{
        text-align: left;
    }
    .footerBox {
        width: 100%;
        height: 50px;
        background-color: #fff;
        -webkit-box-sizing: border-box;
        box-sizing: border-box;
        padding-top: 9px;
        text-align: right;
    }

    .add-template-form > div{
        margin-left: 45px;
    }
    .el-dialog__header{
        z-index: 10;
    }
    .el-dialog{
        margin-top: 12vh !important;
    }
    .el-dialog__wrapper{
        overflow: hidden;
    }
    .el-dialog__header span{
        padding-left: 20px;
    }
    .el-dialog__wrapper .el-dialog__body{
        margin-top: 40px;
        height: 350px;
        overflow: auto;
    }
    /*	#menuContent{
            left: 0 !important;
            top: 40px !important;
            background-color: #eee;
            border: 1px solid #ccc;
        }*/
    #menuContent{
        /*left: 0 !important;*/
        /*top: 40px !important;*/
        background-color: #fff;
        border: 1px solid #ccc;
    }
    #menuContent2{
        /*left: 0 !important;*/
        /*top: 40px !important;*/
        background-color: #fff;
        border: 1px solid #ccc;
    }
    .edit-template-form > div{
        margin-left: 45px;
    }
    /*.edit_dialog .el-form-item.is-required .el-form-item__label:before{*/
    /*content: '';*/
    /*}*/
    #addMenuContent{
        left: 0 !important;
        top: 40px !important;
        background-color: #eee;
        border: 1px solid #ccc;
    }


    .dialogDetails .topNav{
        margin-left: 30px;
        margin-bottom: 20px;
    }
    .dialogDetails .title-template{
        height: 60px;
        line-height: 60px;
        font-size: 18px;
        padding-left: 30px;
        margin-bottom: 10px;
        color: #333333;
        background: #ffffff;
    }

    .dialogDetails .info-template-content{
        background: #ffffff;
    }
    .dialogDetails .item-row{
        height: 46px;
        line-height: 46px;
        font-size: 16px;
        padding-left: 100px;
    }
    .dialogDetails .item-row div:first-of-type{
        color: #aaa;
        text-align: left
    }
    .dialogDetails .item-row div:last-of-type{
        color: #333;
        padding-left: 80px
    }

    .dialogDetails .info-template-content .el-row:nth-child(even){
        background-color: #F8F9FB;
    }
    .dialogDetails .info-template-content .el-row:last-of-type{
        margin-bottom: 30px;
    }
    .dialogDetails .el-dialog{
        overflow: hidden;
        -webkit-box-shadow: 0 0 16px rgba(0,0,0,0.5);
        -moz-box-shadow: 0 0 16px rgba(0,0,0,0.5);
        box-shadow: 0 0 16px rgba(0,0,0,0.5);
    }


    .el-dialog__header{
        -webkit-box-sizing: border-box;
        -moz-box-sizing: border-box;
        box-sizing: border-box;
        border-bottom: 1px solid rgba(255,68,68,1);
        width: 100%;
        position: absolute;
        left: 0px;
        top: 0px;
        background-color: #fff;
    }
    .el-dialog__headerbtn .el-dialog__close{
        color: #aaa;
        font-size: 22px;

    }
    .el-dialog__body{
        padding-top: 75px;
    }

    .dialogDetails .el-dialog__body{
        padding: 50px 0 0 0 ;
    }
    .errorBox{
        color: #fa5555;
        font-size: 12px;
        line-height: 1;
        padding-top: 4px;
        position: absolute;
        top: 100%;
        left: 0;
    }
    .errorBox2333{
        color: #fa5555;
        font-size: 12px;
    }
    /*#selManage label{*/
    /*position: relative;*/
    /*}*/
    #selManage label:before{
        content: '*';
        color: #fa5555;
        margin-right: 4px;

    }


    /*详情页样式*/


    #labelImg{
        display: block;
        width: 146px;
        height: 146px;
        line-height: 146px;
        position: absolute;
        left: 0;
        top: 0;
        z-index: 999;
        background-color: rgba(255,255,255,0.1);
    }
    #imghead {
        filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=image);
    }
    #preview{
        position: relative;
        width: 146px;
        height: 146px;
        overflow: hidden;
        background-color: #f8f9fb;
        border: 1px solid #ddd;
    }
    #preview span{
        position: absolute;
        left: 10%;
        top: 40%;
        font-size: 12px;
    }
    .imagBox{
        position: absolute;
        left: 0;
        top: 0;
        width: 146px;
        height: 146px;
    }
    #uploadImg{
        font-size: 12px;
        position: absolute;
        left: -30000px;
        top: 0;
        opacity:0;
        filter:alpha(opacity=0);
        cursor: pointer;
    }
    .imagesContainer{
        display: inline-block;
        position: relative;
        width: 146px;
        height: 146px;
    }
    .noticeUploadImg{
        position: absolute;
        left: 160px;
        top: 0px;
        font-size: 12px;
        color: #ccc;
    }



    .el-textarea__inner{
        overflow: auto;
    }


    #labelImgNew{
        display: block;
        width: 146px;
        height: 146px;
        line-height: 146px;
        position: absolute;
        left: 0;
        top: 0;
        z-index: 999;
        background-color: rgba(255,255,255,0.1);
    }
    #imgheadNew {
        filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=image);
    }
    #previewNew{
        position: relative;
        width: 146px;
        height: 146px;
        overflow: hidden;
        background-color: #f8f9fb;
        border: 1px solid #ddd;
    }
    #previewNew span{
        position: absolute;
        left: 10%;
        top: 40%;
        font-size: 12px;
    }
    .imagBoxNew{
        position: absolute;
        left: 0;
        top: 0;
        width: 146px;
        height: 146px;
    }
    #uploadImgNew{
        font-size: 12px;
        position: absolute;
        left: -30000px;
        top: 0;
        opacity:0;
        filter:alpha(opacity=0);
        cursor: pointer;
    }
    .imagesContainerNew{
        display: inline-block;
        position: relative;
        width: 146px;
        height: 146px;
    }
    .noticeUploadImgNew{
        position: absolute;
        left: 160px;
        top: 0px;
        font-size: 12px;
        color: #ccc;
    }



    .footerBox{
        padding-right: 50px;
    }
    .el-pager{
        display: inline-block;
        zoom: 1;
    }
</style>